package com.zyl.demo.service;

import com.zyl.demo.beans.Category;
import com.zyl.demo.beans.CategorySub;
import com.zyl.demo.mapper.CategoryMapper;
import com.zyl.demo.mapper.CategorySubMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategorySubService {
    @Autowired
    CategorySubMapper categorySubMapperMapper;

    public List<CategorySub> getAllCategorySub() {
        return categorySubMapperMapper.getAllCategorySub();
    }

    public int addCategory(CategorySub categorySub) {
        return categorySubMapperMapper.addCategorySub(categorySub);
    }

    public int deleteCategory(int categorySubId) {
        return categorySubMapperMapper.deleteCategorySub(categorySubId);
    }
    public List<CategorySub> getCategorySubByCategoryId(int categoryId) {
        return categorySubMapperMapper.getCategorySubByCategoryId(categoryId);
    }


}
